function animate(obj, target,callback) {
    clearInterval(obj.timer)
    obj.timer = setInterval(function () {
        if (obj.offsetLeft == target) {
            clearInterval(obj.timer);
            if(callback){
                callback()
            }
        }
        var foot=(target-obj.offsetLeft)/10
        foot = foot>0?Math.ceil(foot):Math.floor(foot)
        obj.style.left = obj.offsetLeft + foot + 'px'
    }, 15)
}